package com.atguigu.biliplayer.fragments;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.atguigu.biliplayer.ui.MainActivity;

/**
 * 所有顶级Fragment的基类
 * Created by 刘晨龙 on 2015/11/5.
 */
public abstract class BaseFragment extends Fragment {

    protected MainActivity mContext;


    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        mContext = (MainActivity) getActivity();
        View view = initView();
        return view;
    }

    /**
     * 让子类去实现它，添加View
     */
    protected abstract View initView();
}
